import BaseDataModel from "../../Core/BaseDataModel";

interface UserDesc{
    PlayerId:Number,
    NickName:string,
    AvatarId:Number,
    Exp:Number,
    Level:Number,
}


export  class UserModel extends BaseDataModel {
    public static instance: UserModel;

    private data:UserDesc = null;
    public aaa:Number = 111;
    public static getInstance(): UserModel {
        if (UserModel.instance == null) {
            UserModel.instance = new UserModel();
        }

        return UserModel.instance;
    }

    public async login():Promise<UserDesc>{
        this.data = {
            PlayerId:1,
            NickName:"雀巢",
            AvatarId:100,
            Exp:100,
            Level:1
        }

        return Promise.resolve(this.data)
    }


    public getData():UserDesc{
        return this.data
    }
}

export default UserModel.getInstance();